package sctu.edu.java.year2016.team05.zengkun.day20160528.LittleTest1;

import sctu.edu.java.year2016.team06.chenqiang.day20160524.chapter7_2.Calculate;

/**
 * Created by mike on 2016/5/28.
 */





public class MoreAnarchy {
    final float PI=3.14159f;
    public float getArea(float r) {
        float area = PI * r * r;
        return area;
    }//求圆形的面积。
public float getArea(float i,float w){
    float area =i*w;
    return area;

}//求矩形的面积
    public void draw (int num ) {
        System.out.println("画"+num+"个任意形状的图形");
    }//画任意形状的图形
    public void draw (String shape){
        System.out.println("画一个"+shape );

    }
    public static void main(String []args){
        MoreAnarchy calculate =new MoreAnarchy();
        float i=20;
        float w=30;
        float areaRectangle=calculate.getArea(i,w);
        System.out.println("求长为"+i+"宽为"+w+"的矩形面积是"+areaRectangle);
        float r =7;
        float areaCirc=calculate.getArea(r);
        System.out.println("求半径为"+r+"的圆的面积是："+areaCirc);
        int num=7;
        calculate.draw(num);
        calculate.draw("三角形");
    }


}
